package cz.muni.fi.pa036.kiss.Entity;

        
public class BilancePlatebAssembler {
    public static BilancePlatebDTO createDTOFromEntity(BilancePlateb entity){
        BilancePlatebDTO dto = new BilancePlatebDTO();
        StudentDTO studentDto = StudentAssembler.createDTOfromEntity(entity.getStudent());
        if(entity.getId() != null){
            dto.setId(entity.getId());
        }
        if(entity.getPlatba() != null){
            dto.setPlatba(entity.getPlatba());
        }
        if(entity.getStudent() != null){
            dto.setStudent(studentDto);
        }
        return dto; 
    }
    public static BilancePlateb createEntityFromDTO (BilancePlatebDTO dto){
        BilancePlateb entity = new BilancePlateb();
        Student student = StudentAssembler.createEntityfromDTO(dto.getStudent());
        if(dto.getId() != null){
            entity.setId(dto.getId());
        }
        if(dto.getPlatba() != null){
            entity.setPlatba(dto.getPlatba());
        }
        if(dto.getStudent() != null){
            entity.setStudent(student);
        }
        return entity;
    }
}
